package com.yc.vcode.web;


import com.yc.vcode.VcodeException;
import com.yc.bean.Result;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;



@RestControllerAdvice
@Component
public class ExHandler {


    @ExceptionHandler(VcodeException.class)
    Object handleVcodeException(VcodeException e){
        return new Result(0,e.getMessage(),null);
    }
}
